package com.example.arithmeticleetcode.leetcode.dec;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-12-07 11:13
 **/
public class Demo03 {

    public static void main(String[] args) {

    }

    public String interpret(String command) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0, len = command.length(); i < len; i++) {
            char tempChar = command.charAt(i);
            if (tempChar == 'G') {
                sb.append('G');
                continue;
            }
            if (tempChar == '(') {
                if (command.charAt(i + 1) == ')') {
                    sb.append('o');
                    i += 1;
                } else {
                    sb.append("al");
                    i += 2;
                }
            }
        }
        return sb.toString();
    }
}
